<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <link rel="stylesheet" href="$gqt/admin/css/layui.css">
    <link rel="stylesheet" href="$gqt/admin/css/pro_build.css">
    <script src="http://lib.sinaapp.com/js/jquery/1.4.2/jquery.min.js"></script>
    <script src="/GQT/public/static/admin/js/layui.js"></script>
    <style>
        .power_top{
            margin-top: 50px;
        }
    </style>
</head>

<body>
    <div class="layui-container power_top">
        <!-- <div class="layui-col-md3"> -->
        <center>
            <div class="layui-col-md9">
                <form class="layui-form" action="">
                    <div class="layui-form-item">
                        <label class="layui-form-label">工号</label>
                        <div class="layui-input-block">
                            <input type="text" name="tea_id" required lay-verify="required" placeholder="请输入账号" autocomplete="off" class="layui-input" onkeyup="value=value.replace(/[^\d]/g,'')" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">密码</label>
                        <div class="layui-input-inline">
                            <input type="password" name="password" required lay-verify="required" placeholder="请输入密码" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">姓名</label>
                        <div class="layui-input-inline">
                            <input type="text" name="name" required lay-verify="required" placeholder="请输入姓名" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">教师职称</label>
                        <div class="layui-input-inline">
                            <input type="text" name="title"  placeholder="请输入职称" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">系别</label>
                        <div class="layui-input-inline">
                            <input type="text" name="dept"  placeholder="请输入系别" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">职务</label>
                        <div class="layui-input-inline">
                            <input type="text" name="dupt"  placeholder="请输入职务" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">性别</label>
                        <div class="layui-input-block">
                            <input type="radio" name="sex" value="男" title="男" checked>
                            <input type="radio" name="sex" value="女" title="女" >
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">权限选择</label>
                        <div class="layui-input-block">
                            <input type="checkbox" name="score_apply" title="学分申请" value="">
                            <input type="checkbox" name="score_pass" title="学分通过"  value="">

                            <input type="checkbox" name="pro_success" title="结题项目" value="">
                            <input type="checkbox" name="pro_apply" title="项目申请" value="">
                            <input type="checkbox" name="pro_pass" title="项目通过" value="">
                            <input type="checkbox" name="pro_build" title="项目创建" value="">

                            <input type="checkbox" name="user_info" title="学生信息" value="">
                            <input type="checkbox" name="teacher_info" title="教师信息" value="">
                            <input type="checkbox" name="manage_add" title="添加管理" value="">
                            <input type="checkbox" name="announce" title="消息发布" value="">
                            <input type="checkbox" name="operation" title="消息操作" value="">

                            <!-- <input type="checkbox" name="excel_export" title="信息导出" value=""> -->
                            <!-- <input type="checkbox" name="excel_import" title="信息导入" value=""> -->

                            <input type="checkbox" name="score_query" title="综合查询" value="">
                            <!-- <input type="checkbox" name="pro_query" title="项目查询" value=""> -->
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <button class="layui-btn" lay-submit lay-filter="formDemo" type="submit">立即提交</button>
                            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                        </div>
                    </div>
                </form>


            </div>
        </center>
        <!-- </div> -->
    </div>
    <script>
        //Demo
        layui.use('form', function () {
            var form = layui.form;
            //监听提交
            form.on('submit(formDemo)', function (data1) {
                //console.log(data1.field);
                // layer.msg(JSON.stringify(data1.field));
                // var a=JSON.stringify(data1.field);
                $.ajax({
                type: "post",
                url: "manage_insert",
                data:data1.field,
                datatype: "application/text",
                success: function (data) {
                    console.log(1);
                        if (data) {
                        alert("添加成功");
                        };
                        if (!data) {alert("添加失败！该用户已存在！")};
                    }
                });
                return false;
            });
        });
        
        // $(document).ready(function() {
        //     $
        // });
        $(document).click(function(event) {
            $("input:[name='score_apply']:checked").val('学分申请');
            $("input:[name='score_pass']:checked").val('通过信息');

            $("input:[name='pro_apply']:checked").val('项目申请');
            $("input:[name='pro_pass']:checked").val('项目通过');
            $("input:[name='pro_success']:checked").val('结题项目');
            $("input:[name='pro_build']:checked").val('项目创建');

            $("input:[name='user_info']:checked").val('学生信息');
            $("input:[name='teacher_info']:checked").val('教师信息');
            $("input:[name='manage_add']:checked").val('管理员添加');

            $("input:[name='announce']:checked").val('消息发布');
            $("input:[name='operation']:checked").val('消息操作');

            // $("input:[name='excel_export']:checked").val('信息导出');
            // $("input:[name='excel_import']:checked").val('信息导出');

            $("input:[name='score_query']:checked").val('综合查询');
            // $("input:[name='pro_query']:checked").val('项目查询');
        });
    </script>
</body>

</html>
